package com.xcity.logupload;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.xcity.logupload.config.FtpConfig;
import com.xcity.logupload.util.PropertiesLoader;

public class Resources {

	private static FtpConfig ftpConfig;
//	private static ExecutorService pool;
//	private static ScheduledExecutorService scheduler;
	
	public static final Logger LOG = LoggerFactory.getLogger(Resources.class);
	
	public static void load() {
		ftpConfig = PropertiesLoader.load("ftp.properties", FtpConfig.class);
//		pool = new ThreadPoolExecutor(2, 2, 60L, TimeUnit.SECONDS, new LinkedBlockingQueue<Runnable>());
//		scheduler = Executors.newSingleThreadScheduledExecutor();
	}
	
	public static void dispose() {
//		if (pool != null && !pool.isShutdown()) {
//			pool.shutdown();
//			pool = null;
//		}
//		if (scheduler != null && !scheduler.isShutdown()) {
//			scheduler.shutdown();
//			scheduler = null;
//		}
		ftpConfig = null;
	}
	
	public static FtpConfig getFtpConfig() {
		return ftpConfig;
	}
	
//	public static ExecutorService getPool() {
//		return pool;
//	}
	
//	public static ScheduledExecutorService getScheduler() {
//		return scheduler;
//	}
	
	
}
